<template>
  <div>
    <el-card shadow="never" class="margin-30">
      <el-table :data="returnList" border stripe>
        <el-table-column
          fixed="left"
          type="index"
          label="#"
          width="50"
        />
        <el-table-column
          prop="orderSn"
          label="订单编号"
        />
        <el-table-column
          prop="orderId"
          label="订单ID"
        />
        <el-table-column
          prop="createTime"
          label="添加时间"
        />
        <el-table-column
          label="退单状态"
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.status === 3" type="danger" size="mini" effect="dark">已拒绝</el-tag>
            <el-tag v-if="scope.row.status === 2" type="success" size="mini" effect="dark">已完成</el-tag>
            <el-tag v-if="scope.row.status === 1" type="info" size="mini" effect="dark">退货中</el-tag>
            <el-tag v-if="scope.row.status === 0" type="warning" size="mini" effect="dark">待处理</el-tag>
          </template>
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
        >
          <template slot-scope="scope">
            <el-button type="primary" size="mini" icon="el-icon-view" @click="goReturnDetail(scope.row.id)">查看退单</el-button>

          </template>
        </el-table-column>
      </el-table>

    </el-card>

  </div>
</template>
<script>
import {
  findReturnApply as findReturnApplyApi
} from '@/api/order/return'
import mixs from '@/mixins'
export default {
  name: 'ReturnOrder',
  mixins: [mixs],
  data() {
    return {
      returnList: []

    }
  },
  computed: {
  },
  watch: {
  },
  created() {
    this.getReturnList()
  },
  mounted() {
  },
  methods: {
    async getReturnList() {
      const res = await findReturnApplyApi(this.paginationObj.start, this.paginationObj.limit)
      this.returnList = res.data.rows
      this.paginationObj.total = res.data.total
    },
    goReturnDetail(id) {
      this.$router.push({ name: 'ReturnDetail', params: { id }})
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
